jsMath

Krugovi

def krugovi(r, R): v = []; for i in range( 16 ): p = circle( (0,0), R, rgbcolor=(0,0.75,0) ); p += circle( ((R+r)*sin(pi*i/8), (R+r)*cos(pi*i/8)), r, rgbcolor=(1,0.75,0), xmin=-(2*r+R), xmax=(2*r+R), ymin=-(2*r+R), ymax=2*r+R, aspect_ratio=1 ) p += circle( ((R+r)*sin(pi*i/8) + r*sin(R/r*pi*i/8) , (R+r)*cos(pi*i/8) + r*cos(R/r*pi*i/8)), 0.05, rgbcolor=(1,0,0), fill=true ); v.append( p ); a = animate( v ); a.show(); 
       
krugovi(0.5,1.5)